package com.group15.phms;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;

import android.content.Context;

public class VitalSignsController {
 
	public ArrayList<VitalSigns> getVitalsList(Context context, String user, DatabaseHelper db){
		ArrayList<VitalSigns> vList = db.getVitalsList(user);
		return vList;
	}
	
	public static boolean addVitalSigns(int cholesterol, int glucose, int systolic, int diastolic, 
			Date day, Context context, String user, DatabaseHelper db){
		boolean added = true;
		db = new DatabaseHelper(context);
		Calendar c = Calendar.getInstance();
		c.setTime(day);
		
		VitalSigns v = new VitalSigns(glucose, cholesterol, systolic, diastolic, c.getTime());
		if( !db.addVitals(v, user) )
			added = false;
		return added;
	}
	
	
}
